package de.stefanocke.roo.wicket.table;

import java.util.List;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.springframework.roo.classpath.details.ConstructorMetadata;
import org.springframework.roo.classpath.itd.ItdTypeDetailsProvidingMetadataItem;

import de.stefanocke.roo.wicket.RooTableCellComponent;
import de.stefanocke.roo.wicket.base.ModelClassAwareItdMetadataProviderBase;
import de.stefanocke.roo.wicket.base.ModelClassAwareMetadataCreationParams;

/**
 * Provides {@link TableMetadata}.
 * 
 */
@Component
@Service
public final class GenericTableCellComponentMetadataProvider extends
		ModelClassAwareItdMetadataProviderBase<GenericTableCellComponentMetadata, GenericTableCellComponentAnnotationValues> {


	
	public GenericTableCellComponentMetadataProvider() {
		super(RooTableCellComponent.class, GenericTableCellComponentMetadata.class, GenericTableCellComponentAnnotationValues.class,
				TableCellComponentMetadata.class);
	}

	@Override
	protected ItdTypeDetailsProvidingMetadataItem getMetadataInternal(
			ModelClassAwareMetadataCreationParams<GenericTableCellComponentAnnotationValues> cmcp) {
		List<ConstructorMetadata> constructors = getMemberDetails(cmcp.getGovernorPhysicalTypeMetadata()).getConstructors();

		return new GenericTableCellComponentMetadata(cmcp, constructors);
	}

}